home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-22 | 1.1 KB | 54 lines | [TEXT/MSET] |
- \ This module handles the CallFirst and CallLast operations. Aug 91.
-
- : 1ST&LAST 14 - ;
-
- : CallFirst
- ?exec #last ?error 51
- getSelect 1 ++> #1st ; immediate
-
- : CallLast
- ?exec
- getSelect 1 ++> #last ; immediate
-
-
- : (GET) { mark \ #F #L cnt addr -- mark }
- 0 -> #F 0 -> #L
- #1st #last + -> cnt
- BEGIN cnt WHILE >r 1 --> cnt REPEAT \ Reverse into return stk!
- superM
- IF superM 1- 7 btest
- IF superM 1st&last -> addr addr w@ -> #F
- addr 2+ w@ -> #L
- THEN
- THEN
- \ Get 1st
- #F #L + 4* --> addr
- #F 0 ?DO addr @ , 4 ++> addr LOOP
- #1st -> cnt
- BEGIN cnt WHILE r> , 1 --> cnt REPEAT
- \ Get last
- #L 0 ?DO addr @ , 4 ++> addr LOOP
- #last -> cnt
- BEGIN cnt WHILE r> , 1 --> cnt REPEAT
- #F ++> #1st #L ++> #last
- #1st #last or IF #1st w, #last w, THEN
- mark ;
-
- : (C1) { \ addr -- }
- #1st 0EXIT
- thisM 1st&last -> addr #1st #last + 4* --> addr
- #1st FOR
- true -> selfRef?
- addr @ ^class findm swap bind_to_self
- ?unHoldMod 4 ++> addr
- NEXT ;
-
- : (CL) { \ addr -- }
- #last 0EXIT
- thisM 1st&last -> addr
- #last FOR
- true -> selfRef? 4 --> addr
- addr @ ^class findm swap bind_to_self
- ?unHoldMod
- NEXT ;
-